<?php

$hostname="localhost";
$username="root";
$password="root";
$database="db_dinkonst";

//Connnects to database
mysql_connect($hostname,$username,$password);
mysql_select_db($database) or die( "Unable to select database");


$result = mysql_query("select username, city, creator_id, title, description, price, pictureURL from items, users
                       where user_id=creator_id");
 while($row = mysql_fetch_assoc($result)) {
	$username = $row["username"];
	$title = $row["title"];
        $description = $row["description"];
        $price = $row["price"];
        $pictureURL = $row["pictureURL"];
        $city = $row["city"];
	echo("Artist: $username </br>");
        echo("Titel: $title </br>");
        echo("Beskrivning: $description </br>");
        echo("Kostar $price kr </br>");
        print "<img src='$pictureURL'/><br>";
        echo("Finns i: $city <br><br>");
        
        


	} 

mysql_close(); ?>
